<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .style1{
            font-size: large;
            color: red;
        }
    </style>
</head>
<body>
欢迎用户<span th:text="${username}">hello</span>登录
<br><br>
<div th:untext="${username}">能识别文本中的html标签</div>
<br><br>
性别：
<input type="radio" th:checked="${gender} == '男'">男
<input type="radio" th:checked="${gender} == '女'">女
<br><br>
城市
<select>
    <option th:selected="${city} == '北京'">北京</option>
    <option th:selected="${city} == '上海'">上海</option>
    <option th:selected="${city} == '广州'">广州</option>
    <option th:selected="${city} == '深圳'">深圳</option>
</select>
<br><br>
//用户列表
<table border="1">
    <tr>
        <th>编号</th>
        <th>用户名</th>
        <th>密码</th>
    </tr>
    <tr th:each="user:${users}">
        <td th:text="${user.id}"></td>
        <td th:text="${user.username}"></td>
        <td th:text="${user.password}"></td>
    </tr>
</table>
<br><br>
//用户列表(含状态)
<table border="1">
    <tr>
        <th>编号</th>
        <th>用户名</th>
        <th>密码</th>
        <th>索引号</th>
        <th>是否为第一个</th>
        <th>是否为最后一个</th>
        <th>是否为偶数次</th>
    </tr>
    <tr th:each="user,state:${users}">
        <td th:text="${user.id}"></td>
        <td th:text="${user.username}"></td>
        <td th:text="${user.password}"></td>
        <td th:text="${state.index}"></td>
        <td th:text="${state.first}"></td>
        <td th:text="${state.last}"></td>
        <td th:text="${state.even}"></td>
    </tr>
</table>
<br><br>
<div th:if="${username} == admin" th:text="该用户是管理员"></div>
<br><br>
<div th:switch="${city}">
    <div th:case="北京">北京</div>
    <div th:case="上海">上海</div>
    <div th:case="广州">广州</div>
    <div th:case="深圳">深圳</div>
    <div th:case="">不确定</div>
</div>
<br><br>
<input type="text" value="1381234678" th:attr="name = ${name}"/>
<br><br>
<div th:class="style1">测试th:class</div>
<div th:style="'color:orange;'">测试th:style</div>
<br><br>
<div th:object="${user}">
    <div th:text="*{id}"></div>
    <div th:text="*{username}"></div>
    <div th:text="*{password}"></div>
</div>
<br><br>
<a th:href="@{/login}">测试@{}</a>
<br><br>
<a th:href="@{https://www.baidu.com}">百度</a>
<br><br>
成绩及格了吗：<span th:text="${score} >= 60"></span><br>
成绩及格了吗：<span th:text="${score} ge 60"></span>
</body>
</html>